/**
 * @Author:  renyc
 * @Date: 2023年2月9日14:28:29
 */
'use strict';

import * as Cesium from "cesium/Cesium";
import DataSource from "../DataSource";
import SourceType from "../../type/SourceType";

// VECTOR_SOURCE_OPTS = {
//     SOUCE_OPTS,
// }

/**
 * @deprecated
 */
class PrimitiveSource extends DataSource {

    constructor(name, options){

        options = options || {};
        
        super(name, options);        
        this._type = SourceType.VECTOR;
        this._delegate = new Cesium.PrimitiveCollection();
    }

    /**
     * 返回内部delegate属性
     */
    get delegate(){
        return this._delegate;
    }

    /**
     * 清空Source
     * @override
     */
    cleanup(){
        // if(this._delegate){
        //     this._delegate.then(dataSource=>{
        //         dataSource.entities.removeAll();
        //     })
        // }

        if(this._delegate){

            this._delegate.removeAll();
            //this._viewer.scene.primitives.remove(this._delegate);
        }
    }
}

export default PrimitiveSource;